import axios from 'axios';
import Mock from 'mockjs';

export function getData () {
  return axios({
    url: 'api/user',
  })
  .then(res => res.data)
  .catch(() => {
    return Mock.mock({
      'msg|1': ['ok', 'error'],
      'code|1': [200, 999],
    });
  });
}
